<!doctype html>
<html>
<style>
	.my_yaoq{
		color: #42A5F7;
	    height: 2.5rem;
	    line-height: 2.5rem;
	    background: white;
	    text-align: center;
	    font-size: 1rem;
	    width: 60%;
	    margin: 1.2rem 0 0 20%;
	    border: 1px solid #42A5F7;
	}
</style>
	<head>
		<meta charset="UTF-8">
		<title>云商圈</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="__INDEX__/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/css/mall.css" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-icon mui-icon-left-nav mui-pull-left" id="return"></a>
			<h1 class="mui-title">云商圈</h1>

		</header>
		<div class="mui-content" style="height: 100%;">
			<form id='login-form' action="{:url('member/add_union')}" class="mui-input-group gerenzl_group layui-form update_form" style="height: 100%;">
				<ul class="fjysq_slis">
					<li class="clearfix">
						<div class="left">联盟头像</div>
						<div class="right toux">
							<div class="layui-upload-list" style="margin: unset;">
								<button id="test1" type="button" class="file-btn" style="border: 0px;">
						    <img class="layui-upload-img" id="logo" src = "{$union_agent['thumb']}" style="border: 0px;">
						</button>
								<p id="demoText"></p>
							</div>
						</div>
					</li>
					<li class="clearfix">
						<div class="left">联盟名称</div>
						<div class="right clearfix"><input type="text" id="name" value="{$union_agent['name']}" name="name" placeholder="请填写联盟名称"></div>
					</li>
					<li class="clearfix">
						<div class="left">商圈名</div>
						<div class="right clearfix"><input type="text" id="sq_name" value="{$union_agent['sq_name']}" name="sq_name" placeholder="如：北湖商圈"></div>
					</li>
					<li class="clearfix">
						<div class="left">单客次广告费</div>
						<div class="right clearfix">
							<lable disabled="true" type="text" value="0.1" style="width: 80%;margin-right: 5%;">0.2
								<lable>元</lable>
						</div>
					</li>
					<li class="clearfix">
						<div class="left">联系电话</div>
						<div class="right clearfix"><input type="text" value="{$union_agent['tel']}" name="tel" id='tel' placeholder="请填写联系电话"></div>
					</li>
					<li class="clearfix">
						<div class="left">描述</div>
						<div class="right clearfix"><input type="text" value="{$union_agent['content']}" name="content" id='content' placeholder="请添加描述"></div>
					</li>
				</ul>
				<input type="hidden" name="union_id" id="union_id">
				<button type="button" id='join_union' onclick="" class="fjysq_sbtn" style="display: block;">申请入驻</button> 
		</div>
		</form>
		{include file="public/footer" /}
	</body>
</html>
<script>
	$(function(){
		$('#union_id').val(getUrlParam('union_id'));
	})
	
	
	$('join_union').click(function(){
		$.ajax({
			type:"post",
			//请求的url
			//注意，如果我们使用路由器的情况下，我们需要设置一下本地服务器的ip地址
			url: "{:url('index/member/add_union')}",
			//请求的过程中传递过去的参数 json
			data: $('#login-form').serialize(),//表单数据
			//成功了的回调，并且带有返回值
			success: function(data) {
				layer.msg(data.msg, {
				  icon: 1,
				  time: 1500 //2秒关闭（如果不配置，默认是3秒）
				}, function(){
					  if(data.code == 402) {
					  		//注册成为商家
							location.href = "{:url('index/member/step1')}";
					  }else{
					  		location.href="{:url('index/member/index')}";
					  }
				}); 
			}
		})
		
		
	})
	
	
</script>
